package written_examination;
import java.util.*;

//回文串
public class Main_1125_1 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        StringBuffer s1 = new StringBuffer(scanner.nextLine());
        StringBuffer s2 = new StringBuffer(scanner.nextLine());
        int count = 0;
        for(int i = 0;i <= s1.length();i++){
            StringBuffer tmp = new StringBuffer(s1);
            tmp.insert(i,s2);
            if(isPalindrome(tmp)){
                count++;
            }
        }
        System.out.println(count);
    }
    public static boolean isPalindrome(StringBuffer s){
        int i = 0;
        int j = s.length() - 1;
        while(i < j){
            if(s.charAt(i++) != s.charAt(j--)){
                return false;
            }
        }
        return true;
    }
}
